Ext.define('Admin.view.training.TrainingEditForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.trainingEditForm',
    requires: [
        'Ext.button.Button',
        'Ext.form.field.Text',
        'Ext.form.field.Checkbox',
        'Ext.form.field.ComboBox',
        'Ext.form.field.Date',
		'Ext.form.field.Time', 
        'Ext.form.field.Number',
        'Ext.form.field.Hidden',
        'Ext.form.field.Picker',
        'Ext.form.field.TextArea',
        'Ext.form.field.File',
        'Ext.form.field.HtmlEditor'
    ],

    viewModel: {type: 'trainingViewModel'},
    controller: 'trainingViewController',
    //cls: '',

    layout: {
        type:'vbox',
        align:'stretch'
    },

    bodyPadding: 10,
    scrollable: true,

    defaults: {
        labelWidth: 60,
        labelSeparator: ''
    },

    items: [{
        xtype: 'hidden',//hidden
        fieldLabel: 'id',
        name:'id',
        readOnly:true
    },{
        xtype: 'numberfield',//hidden
        fieldLabel: '员工ID',
        name:'empId'
        //readOnly:true
    },{
        xtype: 'textfield',
        fieldLabel: '培训类型',
        name:'type'
    }, {
        xtype: 'textfield',
        fieldLabel: '培训主办单位',
        name:'organizer'
    }, {
        xtype: 'textfield',
        fieldLabel: '培训内容',
        name:'content'
    }, {
        xtype: 'textfield',
        fieldLabel: '培训地点',
        name:'address'
    }, {
        xtype: 'textfield',
        fieldLabel: '培训时长',
        name:'hour'
    }, {
        xtype: 'datefield',
        fieldLabel: '培训开始时间',
        name:'beginTime',
        format: 'Y/m/d H:i:s'
	  },{
        xtype: 'datefield',
        fieldLabel: '培训结束时间',
        name:'overTime',
        format: 'Y/m/d H:i:s'
	}, {
        xtype: 'textfield',
        fieldLabel: '证明人',
        name:'prover'
    } ],

    bbar: {
        overflowHandler: 'menu',
        items: ['->',{
            xtype: 'button',
            ui: 'soft-green',
            text: '提交',
            handler : 'submitEditForm'
        },{
            xtype: 'button',
            ui: 'soft-red',
            text: '取消',
	        handler :function(bt){
	        	var win = bt.up('window');
		        if (win) {
		            win.close();
		        }
	        }
        },'->']
    }
});